<div>
<div class="arrow"><span>◆</span></div>
	<!-- 评论框 -->
<div class="input clearfix" node-type="commentList">
	<div>
	<textarea node-type="textEl" rows="" cols="" action-type="check" style="margin: 0px 0px 3px; padding: 4px 4px 0px; border-color: rgb(198, 198, 198); border-style: solid; border-width: 1px; font-size: 12px; font-family: Tahoma,宋体; word-wrap: break-word; line-height: 18px; overflow: hidden; outline: medium none; height: 20px;" id="tweet_content"></textarea>
	</div>
  <div node-type="widget" class="action clearfix">
    <!-- <span node-type="smileyBtn" alt="表情" title="表情" class="faces"></span> -->
			<div class="post_btn"> <a href="#" class="ico1">表情</a>
				<div class="post_win" style="left:-30px;display:none">
					<div class="post_win_t"></div>
					<a href="#" class="close">关闭</a>
					<div class="post_win_tab clearfix"><a href="#" class="current loding">loading...</a></div>
				</div>
			</div>
  <ul class="commoned_list">
    	<li>
  	<label>
    	<input type="checkbox" name="forward" class="W_checkbox">同时转发到我的微博
    </label>
  </li>
  </ul>
	</div>
	<p class="btn">
  	<a action-data="{$id}" href="#" action-type="post" class="W_btn_b btn_noloading"><span><b class="loading"></b><em node-type="btnText">评论</em></span></a>
	</p>
</div>
	<!-- 评论框 -->
	<!-- 已有评论列表 -->
{foreach $data as $val}
<dl class="comment_list" comment_id="3363366645520345">
	<dt>
  		<a href="weibo/{$val.user.id}.html"><img width="30" height="30" ucardconf="type=1" usercard="id=2298220505" src="{$val.user.profile_image_url}" alt="maqingrong"></a>
  	</dt>
  	<dd>
		<a ucardconf="type=1" href="weibo/{$val.user.id}.html">{$val.user.name}</a>{$val.text} (<span class="realTime">{strtotime($val.created_at)}</span>)
  		<p class="info W_textb">
  			<span class="W_linkb">
  	  			<em class="hover"><a onclick="javascript:window.open('/reportspam?rid=3363366645520345&amp;type=2&amp;url=http%3A%2F%2Fweibo.com%2Faj%2Fcomment%2Fsmall', 'newwindow', 'height=700, width=550, toolbar =yes, menubar=no, scrollbars=no, resizable=yes, location=no, status=no');" href="javascript:void(0);">举报</a><i class="W_vline">|</i></em>
  	  			<a action-data="{$id}" action-type="reply" onclick="return false" href="####">回复</a>
  			</span>
  		</p>
	</dd>
	<dd class="clear"></dd>
</dl>
{/foreach}
{if $comments > 20}
	  <p class="more">
  	后面还有{$comments-20}条评论，<a href="show.html?id={$smarty.get.id}">点击查看<span class="CH">&gt;&gt;</span></a>
  </p>
{/if}
  <div class="clearfix"></div>
</div>
<script type="text/javascript" charset="utf-8">
  $('span.realTime').each(function(){
    $(this).replaceWith(realTime.outPut($(this).html()));
  });
  
  $('a[action-type=post]').click(function(){
    var id = $(this).attr('action-data');
    var p = $(this).parents('div.repeat');
    var c = p.find('textarea');
    var cb = p.find('input[name=forward]');
    if (!c.val()) {
      show_msg('请输入内容', function(){
        c.focus();
      });
      return false;
    }
    loading();
    var item = 0;
    if (cb.is(':checked')) {
        item = 1;
    }
    
    $.post(SITE_URL + '/ajax/reply/commit.html', { id:id, con:c.val(), item:item}, function(data){
        loading('off');
        p.html('<div class="W_loading" node-type="lazyload"><span>正在加载中，请稍候...</span></div>').show().load(SITE_URL+'/ajax/reply.html?id='+id);
    });
    return false;
  });
  
  $('a[action-type="reply"]').click(function(){
    var id = $(this).attr('action-data');
    var textarea = $(this).parents('div.repeat').find('textarea');
    var user_name = $(this).parents('.comment_list').find('a[ucardconf="type=1"]').html();
    var t_val = textarea.val().replace(/回复\@.*\:/, '');
    textarea.val('回复@'+user_name+':'+t_val).focus();
    
    //$(this).attr('ction-data').val() = "@" + $(this).('type=1').html + ":" + $(this).attr('action-data').val();
  });
  
  $('.faces').click(function(){
      alert('try');
  });
</script>